package xin.marcher.module.construction.strategy.route;

import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 商品状态变更路由工厂
 */
@Component
public class ProductStatusStrategyFactory {

    @Resource
    private Map<String, AbstractStatusStrategy> productStatusMap = new ConcurrentHashMap<>(16);

    /**
     * 获取 商品状态变更 路由
     *
     * @param productStatusStrategy 策略
     * @return
     */
    public AbstractStatusStrategy getStrategy(String productStatusStrategy) {
        return productStatusMap.get(productStatusStrategy);
    }

}
